﻿using System.Text.RegularExpressions;

namespace MediaStreamer
{
    public class Validator
    {
        public static bool IsValid(string input)
        {
            if (string.IsNullOrEmpty(input))
                return false;

            //return Regex.IsMatch(input, "^[/a-zA-Z0-9]+$");
            return Regex.IsMatch(input, "^[/a-zA-Z0-9]+[?&a-zA-Z0-9=]*$");
        }

        public static bool IsValidValue(string input)
        {
            if (string.IsNullOrEmpty(input))
                return false;

            // id=pv+v/j8O2/bOqyLZIHGBmzdE29/3mex7
            //return Regex.IsMatch(input, "^[/a-zA-Z0-9]+$");
            return Regex.IsMatch(input, "^[/a-zA-Z0-9]+[?&a-zA-Z0-9=/\\+]*$");
        }
    }
}
